-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide nonce implementation details in metadata #6562
Conversation
All GitHub workflows were cancelled due to failure one of the required jobs. |
@@ -565,5 +577,11 @@ mod tests { | |||
} | |||
type U128WithDefault = TypeWithDefault<u128, Getu128>; | |||
impl WrapAtLeast32Bit for U128WithDefault {} | |||
|
|||
assert_eq!(U8WithDefault::type_info(), <u8 as TypeInfo>::type_info()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, this was not passing before this PR, right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, I just double-checked: it does not pass with the derived TypeInfo
@@ -40,7 +40,7 @@ use serde::{Deserialize, Serialize}; | |||
/// A type that wraps another type and provides a default value. | |||
/// | |||
/// Passes through arithmetical and many other operations to the inner value. | |||
#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen)] | |||
#[derive(Encode, Decode, Debug, MaxEncodedLen)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update the doc of the type to specify this nuance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 06212c9
The only minor downside of this is that now we would have to wait for the next release, and then update the fellowship repo as well Set your reminders @re-gius :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2407
git worktree add --checkout .worktree/backport-6562-to-stable2407 backport-6562-to-stable2407
cd .worktree/backport-6562-to-stable2407
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2409
git worktree add --checkout .worktree/backport-6562-to-stable2409 backport-6562-to-stable2409
cd .worktree/backport-6562-to-stable2409
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2412
git worktree add --checkout .worktree/backport-6562-to-stable2412 backport-6562-to-stable2412
cd .worktree/backport-6562-to-stable2412
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
Backport #6562 into `stable2412` from re-gius. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Giuseppe Re <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Egor_P <[email protected]>
See polkadot-fellows/runtimes#248 : using
TypeWithDefault
having derivedTypeInfo
forNonce
causes a breaking change in metadata for nonce type because it's no longeru64
.Adding a default implementation of
TypeInfo
forTypeWithDefault
to restore the original type info in metadata.